# Computes squared losses 
add.up <-function(pin){ 
	uin <- sum(pin*Z[z.pos,t]) - sum(P[q.pos,t]*Q[q.pos,t])
	return(uin)
}